<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width:200px;
            height: 200px;
            background: rgb(230, 185, 185);
        }
        .box2{
            width:200px;
            height: 200px;
            background: rgb(64, 233, 163);
        }
    </style>
</head>
<body>
    <div id="app">
      <!--  <button v-on:click=" msg='哈哈哈哈' ">按钮</button>
       {{msg}}
       <button v-on:click="fn($event)">按钮</button>
       <button v-on:click="fn">按钮2</button> -->
       <button @click=" msg='哈哈哈哈' ">按钮</button>
       {{msg}}
       <button @click="fn($event)">按钮</button>
       <button @click="fn">按钮2</button>
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
              msg:"123"
            },
            methods:{
                fn(e){
                    console.log(e)
                    alert("我是vue实例的方法")
                }
            }
           
        })

      /* 
      元素.onclick = function(){
          fn()
      }
      元素.onclicl = fn;
       */
    </script>
</body>
</html>